<%@ page language="java" pageEncoding="UTF-8"%>
<%@ include file="../header.jsp" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>授权缴费签约确认</title>
<script src="${ctx}/js/jquery.min.js"></script>
<script type="text/javascript">
function valid(suform){
	var epayCode= suform.epayCode.value;
	if (null == epayCode || "" == epayCode) {
		alert("请输缴费项目编号！");
		return false;
	}
	var merchantId= suform.merchantId.value;
	if (null == merchantId || "" == merchantId) {
		alert("请输入商户编号");
		return false;
	}
	var input1= suform.input1.value;
	if (null == input1 || "" == input1) {
		alert("请输入要素1");
		return false;
	}
	var orderNo= suform.orderNo.value;
	if (null == orderNo || "" == orderNo) {
		alert("请输入商户交易编号");
		return false;
	}
	var verifyCode= suform.orderNo.value;
	if (null == verifyCode || "" == verifyCode) {
		alert("验证码");
		return false;
	}
	
	
}

function resendVerifyCode() {
	var trVersion = "${trVersion}";
	var orderNo = "${orderNo_request}";
	var cardNo = "${cardNo_request}";
	var epayCode = "${epayCode_request}";
	var merchantId = "${merchantId_request}";
	var input1 = "${input1_request}";
	var input2 = "${input2_request}"; 
	var input3 = "${input3_request}"; 
	var input4 = "${input4_request}"; 
	var input5 = "${input5_request}";
	
	$.ajax({
        type:'POST',
        dataType: 'json',
        async: true,
        url:'${ctx}/contract/agentSignResend.do',
        data:{
        	trVersion:trVersion,
        	orderNo:orderNo,
        	cardNo:cardNo,
        	epayCode:epayCode,
        	merchantId:merchantId,                
        	input1:input1,
        	input2:input2,
        	input3:input3,
        	input4:input4,
        	input5:input5        	
        },
        success: function(data, status){
        	alert(data.returnMessage);
            if(null != data.orderNo && "" != data.orderNo) {
            	alert("orderNo:" + orderNo);
            }
        },
        error: function(data, status){
                	alert('获取验证码错误');
        }
    });

}

</script>


</head>
<body>
	<br><br><br><br><br><br>
	<center>
		<h2>授权缴费签约确认接口</h2>
		<h3>接口:${bridge }/jf-openapiweb/bridgeContract/contract</h3>
		<h3>交易码:AgentSignSubmit</h3><br>
		<c:if test="${errMsg != null && ''!= errMsg}">
		<tr>
			<th>返回信息(errMsg):</th>
			<th>${errMsg }</th>
			<a href="javascript:history.go(-1)" > 返回</a>
		</tr>
		</c:if>
		<c:if test="${returnMessage != null && ''!= returnMessage}">
		<tr>
			<th>返回信息(returnMessage):</th>
			<th>${returnMessage }</th>
			<a href="javascript:history.go(-1)" > 返回</a>
		</tr>
		</c:if>		
		<form id="suform" onsubmit="return valid(this);" action='agentSignSubmit.do'  method="post" >
			<input type="hidden" name="trVersion" value="${trVersion_request}" >
			<table>
				<tr>
					<td>商户交易编号(orderNo)：</td>
					<td><input type="text" name="orderNo" value="${orderNo_request}"  readonly /><font color="red">*必输</font></td>
				</tr>
				<tr>
					<td>验证码(verifyCode)：</td>
					<td><input type="text" name="verifyCode"/><font color="red">*必输</font>
	 					<input type="button"  onclick="resendVerifyCode()" value="重发验证码"/>
					</td>
					
				</tr>							
				<tr>
					<td>缴费项目编号(epayCode)：</td>
					<td><input type="text" name="epayCode" value="${epayCode_request}"  readonly /><font color="red">*必输</font></td>
				</tr>
				<tr>
					<td>商户编号(merchantId)：</td>
					<td><input type="text" name="merchantId" value="${merchantId_request}"  readonly /><font color="red">*必输</font></td>
				</tr>
				<tr>
					<td>输入要素1(input1)：</td>
					<td><input type="text" name="input1" value="${input1_request}" readonly /><font color="red">*必输</font></td>
				</tr>
				<tr>
					<td>输入要素2(input2)：</td>
					<td><input type="text" name="input2" value="${input2_request}" readonly /></td>
				</tr>
				<tr>
					<td>输入要素3(input3)：</td>
					<td><input type="text" name="input3" value="${input3_request}" readonly /></td>
				</tr>
				<tr>
					<td>输入要素4(input4)：</td>
					<td><input type="text" name="input4" value="${input4_request}" readonly /></td>
				</tr>
				<tr>
					<td>输入要素5(input5)：</td>
					<td><input type="text" name="input5" value="${input5_request}" readonly /></td>
				</tr>																																					
			</table>
			<input type="submit" value="提交"/> 
		
	</center>
</body>
</html>